#include "BuyZhuRongJiDialog.h"
#include "../../../model/static/StaticItem.h"
#include "../../../model/proxy/UserProxy.h"
#include "../../../model/proxy/ItemProxy.h"
#include "../../../net/NetController.h"
#include "../NotifyDefine.h"

BuyZhuRongJiDialog::BuyZhuRongJiDialog(void)
	:mNeedCost(NULL)
{
}

BuyZhuRongJiDialog::~BuyZhuRongJiDialog(void)
{
	CC_SAFE_RELEASE(mNeedCost);
}

bool BuyZhuRongJiDialog::init()
{
	return true;
}

SEL_MenuHandler BuyZhuRongJiDialog::onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName )
{
	return NULL;
}

SEL_CCControlHandler BuyZhuRongJiDialog::onResolveCCBCCControlSelector( CCObject * pTarget, CCString * pSelectorName )
{
	CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onOkBtnClick", BuyZhuRongJiDialog::onOkBtnClick);
	CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCanselBtnClick", BuyZhuRongJiDialog::onCanselBtnClick);
	return NULL;
}

bool BuyZhuRongJiDialog::onAssignCCBMemberVariable( CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode )
{
	CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mTotalEnergy", CCLabelTTF *, this->mNeedCost);
	return false;
}

void BuyZhuRongJiDialog::onNodeLoaded( CCNode * pNode, CCNodeLoader * pNodeLoader )
{

}

void BuyZhuRongJiDialog::onEnter()
{
	ModelDialog::onEnter();
}

void BuyZhuRongJiDialog::onExit()
{
	ModelDialog::onExit();
}

void BuyZhuRongJiDialog::refresh()
{
}

void BuyZhuRongJiDialog::_onNotification( CCObject* object )
{
	
}

void BuyZhuRongJiDialog::onOkBtnClick( CCObject * pSender, CCControlEvent pCCControlEvent )
{
	Post_Net_Notification(kVCBuyZhuRongJi, NULL)
	close();
}

void BuyZhuRongJiDialog::onCanselBtnClick( CCObject * pSender, CCControlEvent pCCControlEvent )
{
	close();
}

void BuyZhuRongJiDialog::touchScreen()
{
	close();
}
